package com.zhanghe.study.springcloud2.client;


import com.zhanghe.study.springcloud2.client.fallback.DeptClientFallBackFactory;
import com.zhanghe.study.springcloud2.model.Dept;
import com.zhanghe.study.springcloud2.response.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author zh
 * @date 2021/8/23 15:48
 */
@FeignClient(name = "SPRINGCLOUD2-PROVIDER",
        contextId = "DeptClient1",
        fallbackFactory = DeptClientFallBackFactory.class)
public interface DeptClient1 {

    @GetMapping(value = "/dept/get/{id}")
    CommonResult<Dept> get(@PathVariable("id") long id);

    @GetMapping("/timeout")
    String timeout();
}
